package vip.xiaonuo.modular.cms.enums;

/**
 * @ProjectName: snowy_layui_cms
 * @Package: vip.xiaonuo.modular.cms.enums
 * @ClassName: CatalogType
 * @Author: liubaihan
 * @Description: 栏目类型
 * @Date: 2022/9/22 10:07
 */
public enum CatalogType {

    CATALOG("栏目",1),
    MENU("菜单",2),
    ARTICLE("文章",3),
    PRODUCT("产品",4),
    PAGE("页面",5),
    ;

    private String name;
    private int index;
    // 构造方法
    private CatalogType(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (CatalogType c : CatalogType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
